package org.builder.excel;

import java.util.List;
import java.util.Map;

/**
 * @author huangshen
 * @version 0
 * @description ExcelDirector
 */
public class ExcelDirector {

    private final BaseExcelExportBuild builder;

    public ExcelDirector(BaseExcelExportBuild builder) {
        this.builder = builder;
    }

    /**
     * 创建普通Excel
     *
     * @param exportAddress 导出路径
     * @param targetClass   导出bean
     * @param beanList      导出数据集合
     * @return ExcelBuilder
     */
    public <E> BaseExcelExportBuild createNormalExcel(String exportAddress, Class<E> targetClass, List<E> beanList) {
        builder.init(exportAddress, targetClass, beanList)
                .prepared();
        return builder;
    }

    /**
     * 创建普通Excel
     *
     * @param exportAddress 导出路径
     * @param targetClass   导出bean
     * @return ExcelBuilder
     */
    public <E> BaseExcelExportBuild createNormalExcel1(String exportAddress, Class<E> targetClass, List<Map<String, Object>> maps) {
        builder.init1(exportAddress, targetClass, maps)
                .prepared();
        return builder;
    }

}
